//
//  API.h
//  ivcs_ios_demo
//
//  Created by zealcomm user on 2020/10/22.
//  Copyright © 2020 zealcomm user. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <IVCS/ZealcommNetWorkTool.h>
#import <IVCS/CallBackObject.h>
#import "ZcoModelScenarioList.h"

NS_ASSUME_NONNULL_BEGIN

@interface API : NSObject

@property (copy , nonatomic)NSString *token;

declareSingleInstance()

/// 访客登录
/// @param url 登录的url
/// @param name 登录名
/// @param pwd 登录密码
/// @param org 访客所属机构
/// @param complete 结果回调
-(void)loginWithUrl:(nonnull NSString *)url
               name:(nonnull NSString*)name
           password:(nonnull NSString*)pwd
           org:(nonnull NSString*)org
           complete:(completeBlock)complete;



/// 上传文件
/// @param fileData filedata
/// @param fileName filename
/// @param mimeType 文件类型
/// @param onSuccess 成功
/// @param onFailure 失败
-(void)uploadFile:(NSData *)fileData
       url:(NSString *)url
       fileName:(nonnull NSString *)fileName
       mimeType:(NSString *)mimeType
       onSuccess:(void (^)(id))onSuccess
       onFailure:(void (^)(NSError *error))onFailure;



/// 上传确认用户信息
/// @param sessionId 会话id
/// @param url 上传地址
/// @param userInfo 用户信息
/// @param onSuccess 成功,返回formId
/// @param onFailure 失败
-(void)uploadUserInfoWithSessionId:(NSString *)sessionId
                     url:(NSString *)url
                     userInfo:(NSMutableDictionary *)userInfo
                     onSuccess:(void (^)(NSString *))onSuccess
                     onFailure:(void (^)(NSError *error))onFailure;



/// 上传表单数据
/// @param sessionId 会话id
/// @param url 上传url
/// @param parameter 参数
/// @param onSuccess 成功
/// @param onFailure 失败
-(void)uploadFormDataWithSessionId:(NSString *)sessionId
                        url:(NSString *)url
                        parameter:(NSMutableDictionary *)parameter
                        onSuccess:(void (^)(id))onSuccess
                        onFailure:(void (^)(NSError *error))onFailure;

/// 获取已启用的业务场景
-(void)getScenarios:(NSString *)url
          onSuccess:(void (^)(id))onSuccess
          onFailure:(void (^)(NSError * _Nonnull))onFailure;

/// 确认坐席收集的信息
-(void)confirmCollect:(NSDictionary *)data onSuccess:(void (^)(CallBackObject *_Nonnull))onSuccess
            onFailure:(void (^)(NSError * _Nonnull))onFailure;

/// 更新收集信息的表单
-(void)updateCollectForm:(NSDictionary *) data onSuccess:(void (^)(id))onSuccess
               onFailure:(void (^)(NSError * _Nonnull))onFailure;

@end

NS_ASSUME_NONNULL_END
